<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    .container {
        display: flex;
        flex-wrap: wrap; /* 允许项目换行 */
        width: 300px; /* 宽度不足以容纳所有项目 */
        height: 600px;
        border: 1px solid red;
        align-content: center; /* 在交叉轴上居中对齐多行项目 */
    }

    .item {
        width: 100px;
        height: 50px;
        background-color: #f1f1f1;
        margin: 5px;
    }
</style>
<body>

<div class="container">
    <div class="item">项目1</div>
    <div class="item">项目2</div>
    <div class="item">项目3</div>
    <div class="item">项目4</div>
    <div class="item">项目5</div>
</div>
<script>

</script>
</body>

</html>
